home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / General / Texx 0.3 / Profile.exec < prev    next >
Text File  |  1993-11-17  |  2KB  |  90 lines

  1. /* Profile.exec */
  2. say 'Profile.exec';
  3. say 'Date of last change - 11/16/93';
  4.  
  5. /* List the current Mac operating environment */
  6.  
  7. /* Check for 32-bit addressing */
  8. if Addr32Bit() then
  9.      say 'Running with 32-bit addressing';
  10. else
  11.      say 'Running with 24-bit addressing';
  12.  
  13. /* List the current boot drive */
  14. say 'The boot drive is ' || BootDrive();
  15.  
  16. /* List the currently mounted volumes */
  17. say 'The following volumes are currently mounted:';
  18. volumes();
  19. do i = 2 to volume.1 + 1
  20.      say '     ' || volume.i;
  21. end;
  22.  
  23. /* List the real memory installed */
  24. say 'The real memory installed is ' || RealMemory();
  25.  
  26. /* Check for virtual memory */
  27. if VirtualMemory() then
  28. do
  29.      say 'Running with Virtual Memory';
  30.      say 'The total memory is ' || TotalMemory();
  31. end;
  32. else
  33.      say 'Running with real memory only';
  34.  
  35. /* List the active applications */
  36. say 'The following applications are currently active:';
  37. Processes();
  38. do i = 2 to Process.1 + 1
  39.      say '     ' || Process.i;
  40. end;
  41.  
  42. /* target the finder for external commands */
  43. address finder;
  44. if rc <> 0 then   /* Address failed, inform user */
  45.      say 'Profile.exec -- Address finder failed';
  46. else
  47. do   /* Address successfull */
  48.      /* If MS Word temp files exist, move them to the trash */
  49.      /* Set up a path to the system folder */
  50.      path BootDrive() || 'system folder';
  51.      do i = 1 to 4
  52.           if FileExists( 'Word Temp ' || i ) then
  53.                Move Selection 'Word Temp ' || i 0 0 BootDrive() || 'Trash';
  54.      end;
  55.      /* now empty the trash */
  56.         empty trash;
  57.      if rc <> 0 then
  58.          say 'Profile.exec -- Empty Trash failed';
  59.  
  60.      /* Now, open the mounted volumes windows */
  61.      do i = 2 to volume.1 + 1;
  62.          open selection volume.i;
  63.      end;
  64. end;
  65.  
  66. /* add to the exec menu */
  67. path volume.3 || ':texx folder';
  68. addmenu( 'navigator.exec' );
  69. addmenu( 'AppleLink.exec' );
  70. addmenu( 'America Online.exec' );
  71. addmenu( 'Mac Tools.exec' );
  72. addmenu( 'Compact Pro.exec' );
  73. addmenu( 'MPW.exec' );
  74. addmenu( 'ResEdit.exec' );
  75. addmenu( 'Word.exec' );
  76.  
  77. /* add other commands here */
  78. say 'End of Profile.exec';
  79. exit;
  80. addmenu: /* this routine will add to the Exec menu */
  81. arg menu;
  82. /* if the exec does not exist, an error will be returned */
  83. addexecmenu menu;
  84. if rc <> 0 then
  85. do
  86.    say 'Unable to add ' || menu || ' to exec menu';
  87.    say 'rc = ' || rc;
  88. end;
  89. return;
  90.